$(document).ready(function(){
    $('#frame_chatbox').replaceWith('<iframe src="/chatbox"  width="100%" height="100%" id="frame_chatbox" scrolling="no"></iframe>');
    setInterval(function(){
    if($('#frame_chatbox').contents().find('#chatbox_option_disco').css('display') == 'none'){
      
$('#frame_chatbox').contents().find('a[onclick="CB_disconnect();"]').click();
    }
    }, 5000);
    });